package pl.pw.mkmw.pnganimator.file;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * A class for file saving.
 *
 * @author MK
 */
public class FileSaver {

    public void saveByteArray(byte[] array, URI uri) {
        try {
            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(uri.getPath())));
            
            bos.write(array);
            
            bos.close();
        } catch (IOException ex) {
            Logger.getLogger(FileSaver.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
